<template>
  <div>
    <div class="tabs-wrapper">
      <div class="tabs-wrapper-row">
          <div class="tabs">
            <div class="tab" @mouseenter="hanleClick(0)">核酸相关</div>
            <div class="tab" @mouseenter="hanleClick(1)">多肽蛋白</div>
            <div class="tab" @mouseenter="hanleClick(2)">细胞相关</div>
            <div class="tab" @mouseenter="hanleClick(3)">信号传导</div>
            <div class="tab" @mouseenter="hanleClick(4)">抗体</div>
            <div class="tab" @mouseenter="hanleClick(5)">抑制剂激活剂等</div>
            <div class="tab" @mouseenter="hanleClick(6)">常用试剂</div>
            <div class="tab" @mouseenter="hanleClick(7)">耗材</div>
            <div class="tab" @mouseenter="hanleClick(8)">仪器</div>
            <div class="tab" @mouseenter="hanleClick(9)">技术服务</div>
          </div>
        </div>
    </div>
    <div class="tabs-contents" v-if="tabContents">
      <div class="tabs-content" v-if="activateIndex === 0" v-for="item in tempList" :key="item">
        <div style="display: inline-block; width: 20%; position: relative;vertical-align: top;margin-top: 5px;">
          <span>生化试剂</span>
          <span style="float: right; font-size: 12px;padding-top: 5px; padding-right: 10px;">></span>
        </div>
        <div style="display: inline-block; width: 80%;">
          <span class="tab-content-inner">菌种与培养</span>
          <span class="tab-content-inner">酵母相关</span>
          <span class="tab-content-inner">病毒构造</span>
          <span class="tab-content-inner">感受态与制备</span>
          <span class="tab-content-inner">原核载体</span>
          <span class="tab-content-inner">菌种与培养</span>
          <span class="tab-content-inner">真核载体</span>
          <span class="tab-content-inner">报告基因质粒</span>
          <span class="tab-content-inner">基因表达质粒</span>
          <span class="tab-content-inner">荧光探针质粒</span>
          <span class="tab-content-inner">昆虫与酵母质粒</span>
        </div>
      </div>
      <div class="tabs-content" v-if="activateIndex === 1">产品1详情</div>
      <div class="tabs-content" v-if="activateIndex === 2">产品2详情</div>
      <div class="tabs-content" v-if="activateIndex === 3">产品3详情</div>
    </div>
  </div>

</template>

<script setup>
// 这是定义的一个组件，供其它页面调用
import { ref } from 'vue';

const activateIndex = ref(null);
const tabContents = ref(false);
const tempList = ref([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]);


const hanleClick = (index) => {
  tabContents.value = true;
  activateIndex.value = index;
}

const handleTabs = () => {
  tabContents.value = false;
}
</script>
<style scoped>
.tabs-wrapper {
  position: relative;
  z-index: 200;
  height: 380px;
}

.tabs-wrapper-row {
  position: relative;
  margin-left: 200px;
}

.tabs {
  position: relative;
  display: inline-block;
  text-align: center;
  background-color: #267CD6;
  color: #fff;
  height: 380px;
  align-items: center;
  width: 100%;
  padding: 0;
  margin: 0;
}

.tab {
  padding: 8px 0;
}

.tab:hover {
  padding: 8px 0;
  color: #267CD6;
  background-color: #ccdeee;
}

.tabs-contents {
  position: relative;
  color: #00468A;
  padding-left: 20px;
  background-color: #ccdeee;
  z-index: 150;
  top: -380px;
  left: 700px;
  width: 620px;
}

.tabs-content-inner {
  display: inline-block;
  padding-left: 10px;
  margin-left: 3px;
  margin-top: 5px;
}
</style>